<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var a = new Array();
      //赋值  定义一个空字符串a  将[1,2,3,4,5]等push插入

      //第一种
      var tmp = new Array();
      for (var i = 1; i <= 48; i++) {
        if (i % 8 > 0) {
          tmp[(i % 8) - 1] = i;
        }
        if (i % 8 == 0) {
          tmp[7] = i;
          a.push(tmp);
          tmp = [];
        }
      }
      console.log(a);
      //第二种
      var b = new Array();
      for (var i = 1; i <= 25; i++) {
        if (i % 5 == 0) {
          tmp = [i - 4, i - 3, i - 2, i - 1, i];
          b.push(tmp);
        }
      }
      console.log(b);
    </script>
  </body>
</html>
